package com.example.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.demo.Dao.RecruitmentInfoMapper;
import com.example.demo.Dao.UserInfoMapper;
import com.example.demo.Dao.UserRoleMapper;
import com.example.demo.enity.RecruitmentInfo;
import com.example.demo.enity.UserInfo;
import com.example.demo.enity.UserRole;



@Service
public class BaseService {

	@Autowired
	UserInfoMapper userInfoMapper;
	@Autowired
	RecruitmentInfoMapper recruitmentInfoMapper;
	@Autowired
	UserRoleMapper userRoleMapper;
	
	/**
	 * 为用户添加角色。默认为user
	 */
	public void insertUserRoleSelective(UserRole record) {
		userRoleMapper.insertSelective(record);
	}
	/**
	 * 注册新用户
	 */
	public int insertUesrinfoSelective(UserInfo record) {
		
		return userInfoMapper.insertSelective(record);
	}
	
	/**
	 * 模糊查询工作
	 * @param zpname
	 * @return
	 */
	public  List<RecruitmentInfo>  selectRecruitmentInfoByLikeZpname(String zpname){
		return recruitmentInfoMapper.selectRecruitmentInfoByLikeZpname(zpname);
	}
	/**
	 * 根据id查询招聘信息
	 * @param zpid
	 * @return
	 */
	public RecruitmentInfo selectRecByPrimaryKey(Integer zpid) {
		return recruitmentInfoMapper.selectByPrimaryKey(zpid);
	}
}
